//
//  LXUserAddressViewCell.m
//  LvXi_newVersion
//
//  Created by 诸葛孔明 on 16/8/15.
//  Copyright © 2016年 SJT. All rights reserved.
//............................................................................................//
//...............................个人中心-订单详情页-收货人地址cell................................//
//............................................................................................//

#import "LXUserAddressViewCell.h"

@implementation LXUserAddressViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        UILabel *nameLabel = [[UILabel alloc] init];
        nameLabel.font = [UIFont systemFontOfSize:15];
        [self addSubview:nameLabel];
        self.nameLabel = nameLabel;
        
        UILabel *phoneLabel = [[UILabel alloc] init];
        phoneLabel.font = [UIFont systemFontOfSize:12];
        [self addSubview:phoneLabel];
        self.phoneLabel = phoneLabel;
        
        UILabel *addressLabel = [[UILabel alloc] init];
        addressLabel.font = [UIFont systemFontOfSize:13];
        addressLabel.numberOfLines = 0;
        [self addSubview:addressLabel];
        self.addressLabel = addressLabel;
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.nameLabel.width = [self.nameLabel.text sizeInAre:MaxSize font:self.nameLabel.font].width;
    self.nameLabel.height = [self.nameLabel.text sizeInAre:MaxSize font:self.nameLabel.font].height;
    self.nameLabel.x = MineRatio(15);
    self.nameLabel.y = MineRatio(15);
    
    self.phoneLabel.width = [self.phoneLabel.text sizeInAre:MaxSize font:self.phoneLabel.font].width;
    self.phoneLabel.height = [self.phoneLabel.text sizeInAre:MaxSize font:self.phoneLabel.font].height;
    self.phoneLabel.x = self.nameLabel.right + 30;
    self.phoneLabel.y = self.nameLabel.y;
    
    self.addressLabel.height = [self.addressLabel.text sizeInAre:MaxSize font:self.addressLabel.font].height;
    self.addressLabel.x = self.nameLabel.x;
    self.addressLabel.y = self.nameLabel.botton + MineRatio(10);
    self.addressLabel.width = self.width - MineRatio(30);
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
